package me.zhengjie.repository;

import me.zhengjie.dto.sqlServer.PinlaminationunloadTwo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PinlaminationunloadTwoRepository extends JpaRepository<PinlaminationunloadTwo, Integer>, JpaSpecificationExecutor<PinlaminationunloadTwo> {

    @Query("select pi from PinlaminationunloadTwo pi where pi.barcodeNumber=?1 and (pi.inUnbinding!= 1 OR pi.inUnbinding IS null)  order by pi.id desc")
    List<PinlaminationunloadTwo> findPinlaminationunloadTwoByBarcodeNumber(String scannerValue);

    @Query("select pi from PinlaminationunloadTwo pi where pi.potId=?1 ")
    List<PinlaminationunloadTwo> findPinlaminationunloadTwoByPotId(Integer potId);
}
